package com.hxzy.module.back.controller;

import com.hxzy.framework.common.resp.R;
import com.hxzy.framework.common.resp.ResultCode;
import com.hxzy.module.back.api.backaccount.resp.BackAccountResp;
import com.hxzy.module.back.service.BackAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;

/**
 * @Author wy
 * @Description TODO
 * @Date 2024/1/26 14:06
 * @Version 1.0
 */
@RestController
@RequestMapping("/backAccount")
@Api(tags = "中台管理-账户API")
public class BackAccountController {

    @Autowired
    private BackAccountService  backAccountService;


    @ApiOperation(value= "根据账户查询信息")
    @GetMapping(value = "/find/{account}")
    public R<BackAccountResp> findByAccount(@PathVariable(value = "account") String account){
        BackAccountResp resp=this.backAccountService.findByAccount(account);
        if(Objects.isNull(resp)){
            return R.failed(ResultCode.DATA_NOT_FOUND);
        }
        return R.success(resp);
    }


}
